import api from '../../api/index';
import { sdk } from '../../config/sdk';
Page({
  data: {
    loading: true,
    animation: true
  },
  onLoad: function (options) {
    this.getNotice()
  },

  async getNotice() {
    const self = this;
    const { code, message, data } = await sdk.request({ url: api.getNotices });
    if (code != 1000) return this.$error(message);
    self.setData({ 
      notice: data,
      loading: false
    });
    const timer = setTimeout(function () {
      self.setData({ 
        animation: false 
      });
      clearTimeout(timer);
    }, 1000);
  },
})